package com.chushouya.product.dto.admin.tempevaluate;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 模板估价项目选项详情DTO
 */
@Data
@ApiModel(value = "模板估价项目选项详情DTO")
public class TempEvaluateItemValueDetailDTO {

    @ApiModelProperty(value = "模板估价项目选项ID")
    private Long tempItemValueId;

    @ApiModelProperty(value = "模板估价项目ID")
    private Long tempItemId;

    @ApiModelProperty(value = "估价项目选项ID")
    private Long valueId;

    @ApiModelProperty(value = "估价项目选项名称")
    private String valueName;

    @ApiModelProperty(value = "估价扣减金额/比例")
    private BigDecimal value;

    @ApiModelProperty(value = "估价计算方式(0按金额 1按比例)")
    private Integer calcType;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    /**
     * 获取计算类型描述
     */
    public String getCalcTypeDesc() {
        if (calcType == null) {
            return "未知";
        }
        switch (calcType) {
            case 0:
                return "按金额";
            case 1:
                return "按比例";
            default:
                return "未知";
        }
    }
}
